package com.yyq.adms.usermanage.bpo.impl;

import javax.annotation.Resource;

import com.yyq.adms.usermanage.bpo.SysPermBpo;
import com.yyq.adms.usermanage.dao.SysPermDao;
import com.yyq.adms.usermanage.pojo.SysUsers;
import com.yyq.sos.service.BaseBpoImpl;

public class SysPermBpoImpl extends BaseBpoImpl implements SysPermBpo {

	private SysPermDao dao;
	
	
	@Resource(name="sysPermDao")
	public void setDao(SysPermDao dao) {
		this.dao = dao;
		this.setBaseDao(dao);
	}

	
	/**
	 * 用户登录
	 */
	public SysUsers login(SysUsers vo)
	{
		SysUsers obj = (SysUsers)dao.findByPk("from "+SysUsers.class.getName()+" where userName='"+vo.getUserName()+"'");
		if(obj == null)
			return null;
		else{
			if(obj.getPassword().equals(vo.getPassword()))
				return obj;
			else
				return null;
		}
	}
}
